package com.zff.rental.utils.specification;

import jakarta.persistence.criteria.CriteriaBuilder;
import jakarta.persistence.criteria.Path;
import jakarta.persistence.criteria.Predicate;

/**
 * @author HCY
 */
public class LessThanOrEqualPre<Root, Params extends Comparable<? super Params>> extends BasePre<Root, Params, Params> {
    public LessThanOrEqualPre(String name, Params params) {
        super(name, params);
    }

    @Override
    protected Predicate generate(CriteriaBuilder cb, Path<Params> path, Params[] params) {
        return cb.lessThanOrEqualTo(path, params[0]);
    }
}
